<el-header class="page-header"  height="60px" width="100%">
    <div class="h-left">
        <el-image class="logo" src="data/attachment/sitelogo/sitelogo.png?{VERHASH}" fit="contain"></el-image>
         <el-link :underline="false" href="$_G['siteurl']"><el-text tag="b" size="large" style="color:var(--el-text-color-primary)">$_G['setting'][sitename] </el-text></el-link>
    </div>
    <div class="h-center">
        <el-menu
            class="admin-el-menu dzz-menu"
            :default-active="HeaderMenu.active"
            mode="horizontal"
            @select="headerMenuSelect">
            <el-menu-item v-for="item in HeaderMenu.data" :index="item.id">{{ item.name }}</el-menu-item>
        </el-menu>
    </div>
    <div class="h-right"> 
        <el-tooltip content="切换页面配色" placement="bottom">
            <el-button 
                text 
                :icon="DocumentThemeColor=='light'?'Sunny':'Moon'" 
                style="font-size: var(--el-font-size-extra-large);" 
                circle  
                size="large"
                @click="DocumentThemeChange">
            </el-button>
        </el-tooltip>
        <comavatar
            :level="parseInt($_G['pichomelevel'])"
            iscollect="<!--{if defined('PICHOME_LIENCE') && (!$_G['config']['pichomeclosecollect'] || $_G[adminid])}--><!--{/if}-->"
            :adminid="parseInt($_G['adminid'])"
            PICHOME_LIENCE="<!--{if defined('PICHOME_LIENCE')}--><!--{/if}-->"
            :uid="parseInt($_G['uid'])"
            upgrade="<!--{if $_G['setting']['upgrade']}--><!--{/if}-->"
            version="$_G['setting']['version']"
            formhash="{FORMHASH}"
            :isrefresh="true">
            <el-avatar size="40">
                {eval echo avatar_block($_G['uid']);}
            </el-avatar>
        </comavatar>
    </div>
</el-header>

<script>
    const HeaderMixin = {
		data(){
			return {
                HeaderMenu:{
                    active:'systeminfo',
                    data:[
                        {id:'systeminfo',name:'系统信息',url:'index.php?mod=systeminfo'},
                        {id:'library',name:'库管理',url:'index.php?mod=pichome&op=library'},
                        // {id:'tab',name:'专辑设置',url:'index.php?mod=tab&op=admin'},
                        {id:'alonepage',name:'单页管理',url:'index.php?mod=alonepage'},
                        {id:'banner',name:'栏目管理',url:'index.php?mod=banner&op=admin'},
                        {id:'manage',name:'管理工具',url:'index.php?mod=manage'},
                    ]
                }
			}
		},
		methods:{
			headerMenuSelect(id){
				if(this.HeaderMenu.active == id)return false;
				let curr = this.HeaderMenu.data.find(function(current){
					return current.id == id;
				});
				window.location.href = curr.url;
			},
		}
	}
</script>